package tuse.components
{
	import UIFree.uif_component;

	public class ts_elipse extends ts_component {
		public function ts_elipse(parent:uif_component, ax:int=0, ay:int=0, awidth:int=0, aheight:int=0, styleClass:String='') {
			super(parent, ax, ay, awidth, aheight, styleClass);
		}
		
		public function get textBottom(): Number {
			return height * 0.7;
		}

		public function draw_comment(x: int, y: int, width: int, height: int, style: Object): void {
			begin2(style);
			var rounds	: Array = getRounds(style);
			var ah		: Number = textBottom;
			var cw		: Number = width / 2;
			var lw		: Number = width / 10;
			
			this.graphics.moveTo(x + rounds[0], y);
			this.graphics.lineTo(x + width - rounds[1], y);
			this.graphics.curveTo(x + width, y, x + width, y + rounds[1]);
			this.graphics.lineTo(x + width, y + ah - rounds[2]);
			this.graphics.curveTo(x + width, y + ah, x + width - rounds[2], y + ah);
			
			this.graphics.lineTo(x + cw + lw, y + ah);
			this.graphics.curveTo(x + cw + lw * 2, y + height, x + width, y + height);
			this.graphics.curveTo(x + cw + lw, y + height, x + cw - lw, y + ah);
			
			
			this.graphics.lineTo(x + rounds[3], y + ah);
			this.graphics.curveTo(x, y + ah, x, y + ah - rounds[3]);
			this.graphics.lineTo(x, y + rounds[0]);
			this.graphics.curveTo(x, y, x + rounds[0], y);
			if (style.fill_color) this.graphics.endFill();
		}
	}
}